home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Super Collection / Windows 95 Super Collection.iso / win95 / programm / vbxstd20 / vbxdemo.cp_ / VBXDEMO.CPP
Encoding:
C/C++ Source or Header  |  1995-07-20  |  12.0 KB  |  356 lines

  1. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. //
  3. //        VBXDEMO.CPP
  4. //        VBX Studio 2.0 
  5. //        18-jul-95
  6. //        «HEXANET, COPYRIGHT HEXANET 1993-1995, ALL RIGHTS RESERVED
  7. //        EMail: hnet@dialup.francenet.fr / CIS: 100333,27
  8. //        HexaNet SW - BP 385.16 - 75768 PARIS CDX 16 - FRANCE
  9. //
  10. //        You can distribute this file as long as you distribute
  11. //        the full VBX Studio package.
  12. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  13. //        You can use this sample file as you want.
  14. // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  15.  
  16. #include "stdafx.h"
  17. #include "vbxdemo.h"
  18. #include "vbpages.h"
  19.  
  20.  
  21. #ifdef _DEBUG
  22. #undef THIS_FILE
  23. static char BASED_CODE THIS_FILE[] = __FILE__;
  24. #endif
  25.  
  26.  
  27. BOOL bHlpNotHere;
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CVbxdemoApp
  31.  
  32. BEGIN_MESSAGE_MAP(CVbxdemoApp, CWinApp)
  33.     //{{AFX_MSG_MAP(CVbxdemoApp)
  34.         // NOTE - the ClassWizard will add and remove mapping macros here.
  35.         //    DO NOT EDIT what you see in these blocks of generated code!
  36.     //}}AFX_MSG_MAP
  37.     // Standard file based document commands
  38. END_MESSAGE_MAP()
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CVbxdemoApp construction
  42.  
  43. CVbxdemoApp::CVbxdemoApp()
  44. {
  45.     // TODO: add construction code here,
  46.     // Place all significant initialization in InitInstance
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // The one and only CVbxdemoApp object
  51.  
  52. CVbxdemoApp NEAR theApp;
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CVbxdemoApp initialization
  56.  
  57. BOOL CVbxdemoApp::InitInstance()
  58. {
  59.     // Standard initialization
  60.     // If you are not using these features and wish to reduce the size
  61.     //  of your final executable, you should remove from the following
  62.     //  the specific initialization routines you do not need.
  63.     
  64.     CStr szAppDir, szTestVBX,sMessage;
  65.     
  66.     //SetDialogBkColor();        // Set dialog background color to gray
  67.     AfxCtl3dLoad();
  68.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  69.     EnableVBX();               // Initialize VBX support
  70.     
  71.     
  72.     // All VBXs must be here!
  73.     szAppDir.GetAppDir();
  74.     szTestVBX = szAppDir;
  75.     szTestVBX += "VBTEXT.VBX";
  76.     if ( !szTestVBX.DoesFileExist() )
  77.         {
  78.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  79.         sMessage.Replace( "%s", szTestVBX );
  80.         sMessage.MB();
  81.         return TRUE;
  82.         }
  83.     szTestVBX = szAppDir;
  84.     szTestVBX += "VBBITMAP.VBX";
  85.     if ( !szTestVBX.DoesFileExist() )
  86.         {
  87.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  88.         sMessage.Replace( "%s", szTestVBX );
  89.         sMessage.MB();
  90.         return TRUE;
  91.         }
  92.     szTestVBX = szAppDir;
  93.     szTestVBX += "VBLIST.VBX";
  94.     if ( !szTestVBX.DoesFileExist() )
  95.         {
  96.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  97.         sMessage.Replace( "%s", szTestVBX );
  98.         sMessage.MB();
  99.         return TRUE;
  100.         }
  101.     szTestVBX = szAppDir;
  102.     szTestVBX += "VBLIST2.VBX";
  103.     if ( !szTestVBX.DoesFileExist() )
  104.         {
  105.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  106.         sMessage.Replace( "%s", szTestVBX );
  107.         sMessage.MB();
  108.         return TRUE;
  109.         }
  110.     szTestVBX = szAppDir;
  111.     szTestVBX += "VBFLIST.VBX";
  112.     if ( !szTestVBX.DoesFileExist() )
  113.         {
  114.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  115.         sMessage.Replace( "%s", szTestVBX );
  116.         sMessage.MB();
  117.         return TRUE;
  118.         }
  119.     szTestVBX = szAppDir;
  120.     szTestVBX += "VBFLIST2.VBX";
  121.     if ( !szTestVBX.DoesFileExist() )
  122.         {
  123.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  124.         sMessage.Replace( "%s", szTestVBX );
  125.         sMessage.MB();
  126.         return TRUE;
  127.         }
  128.     szTestVBX = szAppDir;
  129.     szTestVBX += "VBCOMBO.VBX";
  130.     if ( !szTestVBX.DoesFileExist() )
  131.         {
  132.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  133.         sMessage.Replace( "%s", szTestVBX );
  134.         sMessage.MB();
  135.         return TRUE;
  136.         }
  137.     szTestVBX = szAppDir;
  138.     szTestVBX += "VBFCOMBO.VBX";
  139.     if ( !szTestVBX.DoesFileExist() )
  140.         {
  141.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  142.         sMessage.Replace( "%s", szTestVBX );
  143.         sMessage.MB();
  144.         return TRUE;
  145.         }
  146.     szTestVBX = szAppDir;
  147.     szTestVBX += "VBFLXTXT.VBX";
  148.     if ( !szTestVBX.DoesFileExist() )
  149.         {
  150.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  151.         sMessage.Replace( "%s", szTestVBX );
  152.         sMessage.MB();
  153.         return TRUE;
  154.         }
  155.     szTestVBX = szAppDir;
  156.     szTestVBX += "VBMASK.VBX";
  157.     if ( !szTestVBX.DoesFileExist() )
  158.         {
  159.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  160.         sMessage.Replace( "%s", szTestVBX );
  161.         sMessage.MB();
  162.         return TRUE;
  163.         }
  164.     szTestVBX = szAppDir;
  165.     szTestVBX += "VBEDIT.VBX";
  166.     if ( !szTestVBX.DoesFileExist() )
  167.         {
  168.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  169.         sMessage.Replace( "%s", szTestVBX );
  170.         sMessage.MB();
  171.         return TRUE;
  172.         }
  173.     szTestVBX = szAppDir;
  174.     szTestVBX += "VBGAUGE.VBX";
  175.     if ( !szTestVBX.DoesFileExist() )
  176.         {
  177.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  178.         sMessage.Replace( "%s", szTestVBX );
  179.         sMessage.MB();
  180.         return TRUE;
  181.         }
  182.     szTestVBX = szAppDir;
  183.     szTestVBX += "VBSPIN.VBX";
  184.     if ( !szTestVBX.DoesFileExist() )
  185.         {
  186.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  187.         sMessage.Replace( "%s", szTestVBX );
  188.         sMessage.MB();
  189.         return TRUE;
  190.         }
  191.     szTestVBX = szAppDir;
  192.     szTestVBX += "VBTAB.VBX";
  193.     if ( !szTestVBX.DoesFileExist() )
  194.         {
  195.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  196.         sMessage.Replace( "%s", szTestVBX );
  197.         sMessage.MB();
  198.         return TRUE;
  199.         }
  200.     szTestVBX = szAppDir;
  201.     szTestVBX += "VBLINE.VBX";
  202.     if ( !szTestVBX.DoesFileExist() )
  203.         {
  204.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  205.         sMessage.Replace( "%s", szTestVBX );
  206.         sMessage.MB();
  207.         return TRUE;
  208.         }
  209.     szTestVBX = szAppDir;
  210.     szTestVBX += "VBPICBTN.VBX";
  211.     if ( !szTestVBX.DoesFileExist() )
  212.         {
  213.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  214.         sMessage.Replace( "%s", szTestVBX );
  215.         sMessage.MB();
  216.         return TRUE;
  217.         }
  218.     szTestVBX = szAppDir;
  219.     szTestVBX += "VBANIM.VBX";
  220.     if ( !szTestVBX.DoesFileExist() )
  221.         {
  222.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  223.         sMessage.Replace( "%s", szTestVBX );
  224.         sMessage.MB();
  225.         return TRUE;
  226.         }
  227.     szTestVBX = szAppDir;
  228.     szTestVBX += "VBFINFO.VBX";
  229.     if ( !szTestVBX.DoesFileExist() )
  230.         {
  231.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  232.         sMessage.Replace( "%s", szTestVBX );
  233.         sMessage.MB();
  234.         return TRUE;
  235.         }
  236.     szTestVBX = szAppDir;
  237.     szTestVBX += "VBINI.VBX";
  238.     if ( !szTestVBX.DoesFileExist() )
  239.         {
  240.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  241.         sMessage.Replace( "%s", szTestVBX );
  242.         sMessage.MB();
  243.         return TRUE;
  244.         }
  245.     szTestVBX = szAppDir;
  246.     szTestVBX += "VBDDROP.VBX";
  247.     if ( !szTestVBX.DoesFileExist() )
  248.         {
  249.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  250.         sMessage.Replace( "%s", szTestVBX );
  251.         sMessage.MB();
  252.         return TRUE;
  253.         }
  254.     szTestVBX = szAppDir;
  255.     szTestVBX += "VB3D.VBX";
  256.     if ( !szTestVBX.DoesFileExist() )
  257.         {
  258.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  259.         sMessage.Replace( "%s", szTestVBX );
  260.         sMessage.MB();
  261.         return TRUE;
  262.         }
  263.     szTestVBX = szAppDir;
  264.     szTestVBX += "VBNOTE.VBX";
  265.     if ( !szTestVBX.DoesFileExist() )
  266.         {
  267.         sMessage = "Error!\nCan' t load %s.\nYou may have to re-install VBX Studio 2.0 to use this sample.";
  268.         sMessage.Replace( "%s", szTestVBX );
  269.         sMessage.MB();
  270.         return TRUE;
  271.         }
  272.     szTestVBX = szAppDir;
  273.     szTestVBX += "VBXSTD20.HLP";
  274.     if ( !szTestVBX.DoesFileExist() )
  275.         {
  276.         sMessage = "Warning.\nVBXSTD20.HLP is missing: You can' t use the <More> button\nto run this help file.";
  277.         sMessage.Replace( "%s", szTestVBX );
  278.         sMessage.MB();
  279.         bHlpNotHere = TRUE;
  280.         }
  281.     
  282.     CPropertySheet pMainDialog("VBX Studio 2.0 - Demonstration program");
  283.     CDlgVBOverview pPage1;
  284.     CDlgVBList pPage2;
  285.     CDlgVBTabList pPage3;
  286.     CDlgVBFList pPage4;
  287.     CDlgVBTabFList pPage5;
  288.     CDlgVBCombo pPage6;
  289.     CDlgVBFCombo pPage7;
  290.     CDlgVBEdit pPage8;
  291.     CDlgVBMask pPage9;
  292.     CDlgVBText pPage10;
  293.     CDlgVBFlxTxt pPage11;
  294.     CDlgVBSpin pPage12;
  295.     CDlgVBGauge pPage13;
  296.     CDlgVBTab pPage14;
  297.     CDlgVBLine pPage15;
  298.     CDlgVBPicBtn pPage16;
  299.     CDlgVBBitmap pPage17;
  300.     CDlgVBAnim pPage18;
  301.     CDlgVBDDrop pPage19;
  302.     CDlgVB3D pPage20;
  303.     CDlgVBNote pPage21;
  304.     CDlgVBFInfo pPage22;
  305.     CDlgVBIni pPage23;
  306.     pMainDialog.AddPage( (CPropertyPage*)&pPage1 );
  307.     pMainDialog.AddPage( (CPropertyPage*)&pPage2 );
  308.     pMainDialog.AddPage( (CPropertyPage*)&pPage3 );
  309.     pMainDialog.AddPage( (CPropertyPage*)&pPage4 );
  310.     pMainDialog.AddPage( (CPropertyPage*)&pPage5 );
  311.     pMainDialog.AddPage( (CPropertyPage*)&pPage6 );
  312.     pMainDialog.AddPage( (CPropertyPage*)&pPage7 );
  313.     pMainDialog.AddPage( (CPropertyPage*)&pPage8 );
  314.     pMainDialog.AddPage( (CPropertyPage*)&pPage9 );
  315.     pMainDialog.AddPage( (CPropertyPage*)&pPage10 );
  316.     pMainDialog.AddPage( (CPropertyPage*)&pPage11 );
  317.     pMainDialog.AddPage( (CPropertyPage*)&pPage12 );
  318.     pMainDialog.AddPage( (CPropertyPage*)&pPage13 );
  319.     pMainDialog.AddPage( (CPropertyPage*)&pPage14 );
  320.     pMainDialog.AddPage( (CPropertyPage*)&pPage15 );
  321.     pMainDialog.AddPage( (CPropertyPage*)&pPage16 );
  322.     pMainDialog.AddPage( (CPropertyPage*)&pPage17 );
  323.     pMainDialog.AddPage( (CPropertyPage*)&pPage18 );
  324.     pMainDialog.AddPage( (CPropertyPage*)&pPage19 );
  325.     pMainDialog.AddPage( (CPropertyPage*)&pPage20 );
  326.     pMainDialog.AddPage( (CPropertyPage*)&pPage21 );
  327.     pMainDialog.AddPage( (CPropertyPage*)&pPage22 );
  328.     pMainDialog.AddPage( (CPropertyPage*)&pPage23 );
  329.     pMainDialog.DoModal();
  330.     return TRUE;
  331. }
  332.  
  333.  
  334. int CVbxdemoApp::ExitInstance()
  335. {                                 
  336. AfxCtl3dUnload();
  337. return CWinApp::ExitInstance();
  338. }
  339.  
  340. /////////////////////////////////////////////////////////////////////////////
  341. // VB-Event registration
  342. // (calls to AfxRegisterVBEvent will be placed here by ClassWizard)
  343.  
  344. //{{AFX_VBX_REGISTER_MAP()
  345.     UINT NEAR VBN_FILEDROPPED = AfxRegisterVBEvent("FILEDROPPED");
  346.     UINT NEAR VBN_UPDATE = AfxRegisterVBEvent("UPDATE");
  347.     UINT NEAR VBN_SCROLLUP = AfxRegisterVBEvent("SCROLLUP");
  348.     UINT NEAR VBN_SCROLLDN = AfxRegisterVBEvent("SCROLLDN");
  349.     UINT NEAR VBN_SELCHANGE = AfxRegisterVBEvent("SELCHANGE");
  350.     UINT NEAR VBN_DBLCLICK = AfxRegisterVBEvent("DBLCLICK");
  351.     UINT NEAR VBN_CLICK = AfxRegisterVBEvent("CLICK");
  352. //}}AFX_VBX_REGISTER_MAP
  353.  
  354. /////////////////////////////////////////////////////////////////////////////
  355. // CVbxdemoApp commands
  356.